﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SpEasyClasses
{
    public class Channel
    {
        /// <summary>
        /// A 16-bit integer that represents the channel id
        /// </summary>
        private Int16 Id;
        /// <summary>
        /// Gets or Sets the name of the channel
        /// </summary>
        public String Name { get; set; }
        /// <summary>
        /// Gets or Sets the channels description
        /// </summary>
        public String Description { get; set; }
        /// <summary>
        /// Gets or Sets the channels password
        /// </summary>
        public String Password { get; set; }
        /// <summary>
        /// A list containing all the users currently in the channel
        /// </summary>
        private List<User> Users;
        /// <summary>
        /// Gets the Channel ID
        /// </summary>
        public Int16 ChannelID
        {
            get { return this.Id; }
        }

        public Channel(Int16 id, String name) : this(id, name, "", "") { }

        public Channel(Int16 id, String name, String password) : this(id, name, "", password) { }

        public Channel(Int16 id, String name, String desc, String password)
        {
            this.Id = id;
            this.Users = new List<User>();
            this.Name = name;
            this.Description = desc;
            this.Password = password;
        }

        public void AddUser(User user)
        {
            this.Users.Add(user);
        }

        public void RemoveUser(User user)
        {
            this.Users.Remove(user);
        }
    }
}
